<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>流水灯效果</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    body{
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        min-height: 100vh;
        background-color: #000;
    }
    .box{
        padding: 10vmin 12vmin;
        background-color: #fff;
        border-radius: 5vmin;
        color: #0bf0f0;
        font-size: 5vmin;
        position: relative;
        overflow: hidden;
        z-index: 0; /* 设置z-index为0，确保边框在背景之前 */
    }
    .box::before{
        content: '';
        width: 200%;
        height: 200%;
        background-color: #22292f; 
        position: absolute;
        left: -50%;
        top: -50%;
        background-image: conic-gradient(
            transparent, #0ddfdf, transparent 30%
        );
        z-index: -2;
        animation: rotate 5s linear infinite;
    }
    /* 绑定动画360旋转即可 */
    @keyframes rotate {
        to{
            transform: rotate(360deg);
        }
    }
    .box::after
    {
        content: '';
        position: absolute;
        inset: 1vmin;
        background-color: #000;
        border-radius: 4vmin;
        z-index: -1;
    }

</style>

<body>
    <div class="box">流水灯边框</div>
</body>
</html>